package com.zxy.hotel.entity;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author 14995
 * @description
 * @create 2021-12-12 下午 7:47
 */
@Data
@Accessors(chain = true)
public class RS {
    private Integer code;
    private String message;
    private Object data;

    private RS() {
    }

    public static RS ok() {
        return new RS().setCode(0).setMessage("成功");
    }

    public static RS fail() {
        return new RS().setCode(-1);
    }

    public RS data(Object data) {
        return this.setData(data);
    }

    public RS message(String message){
        return this.setMessage(message);
    }

}
